package bl;

import java.util.ArrayList;
import java.util.List;

import dal.GeneralManage;
import entities.Entity;

public class EntityManager 
{
	private static EntityManager instance;
	
	private EntityManager(){};
	
	public static EntityManager getInstance()
	{
		if (instance == null)
		{
			instance = new EntityManager();
		}

		return instance;
	}
	
	public ArrayList<Integer> add(ArrayList<Entity> entitiesToAdd)
	{
		return GeneralManage.getInstance().add(entitiesToAdd);
	}
	
	public Integer add(Entity entityToAdd)
	{
		return GeneralManage.getInstance().add(entityToAdd);
	}
	
	@SuppressWarnings("rawtypes")
	public List get(Class entity, ArrayList<Class> byType,
			ArrayList<ArrayList<Entity>> byEntity)
	{
		return GeneralManage.getInstance().get(entity, byType, byEntity);
	}
	
	@SuppressWarnings("rawtypes")
	public List getAll(Class entity)
	{
		return GeneralManage.getInstance().getAll(entity);
	}
	
	@SuppressWarnings("rawtypes")
	public void delete(Class entityToDelete, Integer entityID)
	{
		GeneralManage.getInstance().delete(entityToDelete, entityID);
	}
}